#include<graphics.h>
#include<stdio.h>
#include<conio.h>
#include<dos.h>

int xa,xb,ya,yb,x0,y0,x1,y1;
void pol(int xa,int ya,int xb,int yb)
{

printf("Enter x0 and y0:");
scanf("%d%d",&xa,&ya);
printf("Enter x1 and y1:");
scanf("%d%d",&xb,&yb);
x0=xa;x1=xb;y0=ya;y1=yb;
}
int main()
{
int gd=DETECT,gm,i;
initgraph(&gd,&gm,"C:\\Turboc3\\BGI");
printf("1:Solid line\n");
printf("2:Dotted line\n");
printf("3:Dashed line\n");
scanf("%d",&i);
switch(i)
{
case 1:
pol(xa,ya,xb,yb);
setlinestyle(SOLID_LINE,1,1);
line(x0,y0,x1,y1);
getch();
cleardevice();
break;
case 2:
pol(xa,ya,xb,yb);
setlinestyle(DOTTED_LINE,1,1);
line(x0,y0,x1,y1);
getch();
cleardevice();
break;
case 3:
pol(xa,ya,xb,yb);
setlinestyle(DASHED_LINE,1,1);
line(x0,y0,x1,y1);
getch();
cleardevice();
break;
}
getch();
closegraph();
}